#ifndef QALPHACHOOSER_H
#define QALPHACHOOSER_H

#include <QWidget>
#include <QMouseEvent>
#include <QPainter>

class QAlphaChooser : public QWidget
{
    Q_OBJECT
    Q_PROPERTY(QColor hilightColor READ getHlColor WRITE setHlColor);
    Q_PROPERTY(QColor bgColor READ getBgColor WRITE setBgColor);
public:
    QAlphaChooser(QWidget *parent = 0);
    void drawCell(int x, int y, bool hl);
    QColor getHlColor() const;
    void setHlColor(const QColor &color);
    QColor getBgColor() const;
    void setBgColor(const QColor &color);
    QSize sizeHint() const;

signals:
    void clicked(QChar c);
protected:
    void paintEvent(QPaintEvent *event);
    void mouseMoveEvent ( QMouseEvent * event );
    void mousePressEvent ( QMouseEvent * event );
private:
    int cellSize() const;
    int choosedX, choosedY;
    QColor hl_color;
    QColor bg_color;
};

#endif // QALPHACHOOSER_H
